using System.Diagnostics;
using System.Threading;

namespace Seagull.Events
{
    [DebuggerDisplay("{ToString()}")]
    public class RegistrationTokenSource
    {
        private int _token;

        public RegistrationToken Next()
        {
            return new RegistrationToken(Interlocked.Increment(ref _token));
        }

        public override string ToString()
        {
            return string.Format("Current token: {0}", _token);
        }
    }
}